package io.terminus.spzx.user.service.impl;

import io.terminus.spzx.model.entity.user.UserAddress;
import io.terminus.spzx.user.mapper.UserAddressMapper;
import io.terminus.spzx.user.service.UserAddressService;
import io.terminus.spzx.utils.AuthContextUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lichunlong lcl253137@alibaba-inc.com
 * @desc 用户地址Service实现类
 * @date 2024-11-28
 */
@Service
@RequiredArgsConstructor
public class UserAddressServiceImpl implements UserAddressService {

    private final UserAddressMapper userAddressMapper;

    @Override
    public List<UserAddress> findUserAddressList() {
        return userAddressMapper.findByUserId(AuthContextUtil.getUserId());
    }

    @Override
    public UserAddress getById(Long id) {
        return userAddressMapper.getById(id);
    }
}
